<div class="main row">
    <div class="catego-title">
        <a href="#"><span><?php echo $page_title; ?></span></a>
    </div>
    <section class="content col-md-7 col-sm-7 col-xs-12 ">
        <?php
        if (isset($aNews) && count($aNews) > 0) {
            if ($news_cate!="van-ban-phap-quy"){
                $parent_cate_url = "";
                if ($aNews[0]->parent_cate_url != "")
                    $parent_cate_url = $aNews[0]->parent_cate_url . "/";
        ?> 
        <article class="block-feature block-feature-1">
            <a class="thumbs" href="<?php echo $base_url . $parent_cate_url . $aNews[0]->news_cate_url . "/" . $aNews[0]->url . "-" . $aNews[0]->news_id; ?>.html" title="​<?php echo $aNews[0]->title; ?>">
                <img src="<?php echo $img_url; ?>style/<?php echo $aNews[0]->img_thumb3; ?>" alt="​<?php echo $aNews[0]->title; ?>"> </a>
            <h1>
					<a href="<?php echo $base_url . $parent_cate_url . $aNews[0]->news_cate_url . "/" . $aNews[0]->url . "-" . $aNews[0]->news_id; ?>.html" title="​<?php echo $aNews[0]->title; ?>">
						​<?php echo $aNews[0]->title; ?></a>
				</h1>
            <p><?php echo $aNews[0]->short_desc; ?></p>
        </article>
             
        <div class="wrapper-article row">
            <?php
                $parent_cate_url = "";
                for ($i = 1; $i < 4; $i++) {
                    if ($aNews[$i]->parent_cate_url != "")
                        $parent_cate_url = $aNews[$i]->parent_cate_url . "/";
            ?>                 
            <article class="col-xs-12 col-sm-4 col-md-4">
                <div>
                    <a class="thumbs img_165_93" href="<?php echo $base_url . $parent_cate_url . $aNews[$i]->news_cate_url . "/" . $aNews[$i]->url . "-" . $aNews[$i]->news_id; ?>.html" title="​<?php echo $aNews[$i]->title; ?>">
                        <img src="<?php echo $img_url; ?>style/<?php echo $aNews[$i]->img_thumb2; ?>" alt="​<?php echo $aNews[$i]->title; ?>"> </a>
                    <h3>
							<a href="<?php echo $base_url . $parent_cate_url . $aNews[$i]->news_cate_url . "/" . $aNews[$i]->url . "-" . $aNews[$i]->news_id; ?>.html" title="​<?php echo $aNews[$i]->title; ?>">
								​<?php echo $aNews[$i]->title; ?></a>
						</h3>
                    <p class="desc"><?php echo $aNews[$i]->short_desc; ?></p>
                </div>
            </article>           
            <?php
                    $parent_cate_url = "";
                }
            ?>               
        </div>

        <?php
            }
        }
        else
            echo "<div align='center' class='nodata'>" . $page_nodata . "</div>";
        ?>

        <div class="highlight highlight-1">
            <h2 class="title clearfix">
			<a href="#" title="javascript:;">Tin mới nhất</a>
		</h2>


            <div class="newhot_most_content">

                <?php                
                for ($i = 4; $i < 20; $i++) {
                    if ($aNews[$i]->parent_cate_url != "")
                        $parent_cate_url = $aNews[$i]->parent_cate_url . "/";
                    if ($i == 4){
                ?> 
                <article class="block-article block-article-1">
                    <?php
                    } else {
                    ?>
                <article class="block-article ">                    
                    <?php
                    }
                    if (strpos(strtolower($aNews[$i]->img_thumb2),'.jpg') !== false
                            || strpos(strtolower($aNews[$i]->img_thumb2),'.jpeg') !== false
                            || strpos(strtolower($aNews[$i]->img_thumb2),'.png') !== false){
                    ?>
                    <a class="thumbs img_165_93" href="<?php echo $base_url . $parent_cate_url . $aNews[$i]->news_cate_url . "/" . $aNews[$i]->url . "-" . $aNews[$i]->news_id; ?>.html">
                        <img src="<?php echo $img_url; ?>style/<?php echo $aNews[$i]->img_thumb2; ?>" alt="<?php echo $aNews[$i]->title; ?>"> </a>
                    <?php 
                    }
                    ?>
                    <h3><a href="<?php echo $base_url . $parent_cate_url . $aNews[$i]->news_cate_url . "/" . $aNews[$i]->url . "-" . $aNews[$i]->news_id; ?>.html">
                        <?php echo $aNews[$i]->title; ?><span class="icon-photos"></span></a>
                    </h3>
                    <p><?php echo $aNews[$i]->short_desc; ?></p>
                </article>                
                <?php
                    $parent_cate_url = "";
                }
                ?>  
            </div>
            <input type="hidden" id="page_number" name="page_number" value="1" />
            <a onclick="return viewMore('<?php echo $base_url; ?>xem-them-mobile', <?php echo $news_cate_id; ?>, <?php echo $total_records; ?>);" class="btn-more-1" href="javascript:void(0);"><span>Xem thêm</span></a>
        </div>


    </section>
    <aside class="sidebar col-md-5 col-sm-5 col-xs-12 ">

        <div class="block-1">
            <h2 class=""><a href="javascript:void(0)" title="Tin đọc nhiều">Tin đọc nhiều</a></h2>
            <?php
            if (isset($aMostView[0]) && count($aMostView) >= 5) {
                $parent_cate_url = "";
                if (isset($aMostView[0]->parent_cate_url) && $aMostView[0]->parent_cate_url != "")
                    $parent_cate_url = $aMostView[0]->parent_cate_url . "/";
            ?>
            <article>
                <a class="thumbs img_165_93" href="<?php echo $base_url . $parent_cate_url . $aMostView[0]->news_cate_url . "/" . $aMostView[0]->url . "-" . $aMostView[0]->news_id; ?>.html" title="​​<?php echo $aMostView[0]->title; ?>">
                    <img src="<?php echo $img_url; ?>style/<?php echo $aMostView[0]->img_thumb2; ?>" alt="​​<?php echo $aMostView[0]->title; ?>"> </a>
                <h3>
						<a href="<?php echo $base_url . $parent_cate_url . $aMostView[0]->news_cate_url . "/" . $aMostView[0]->url . "-" . $aMostView[0]->news_id; ?>.html" title="​​<?php echo $aMostView[0]->title; ?>">
							​<?php echo $aMostView[0]->title; ?></a>
					</h3>
            </article>
            
            <ul class="list-new">
                <?php
                $i = 1;
                array_shift($aMostView); //next record
                foreach ($aMostView as $key => $item):
                    if ($i >= 8) 
                        break;
                    if ($item->parent_cate_url != "")
                        $parent_cate_url = $item->parent_cate_url . "/";
                ?>                    
                <li>
                    <a href="<?php echo $base_url . $parent_cate_url . "/" . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" title="<?php echo $item->title; ?>">
                        <?php echo $item->title; ?></a>
                </li>
                <?php
                    $i++;
                    $parent_cate_url = "";
                endforeach;
                ?>                
            </ul>
            <?php
            }
            ?>
        </div>
        
        <div class="block-1">
            <h2 class="">
                <a title="Tin khác" href="#">Tin khác</a>
            </h2>
            <?php
            if (isset($aFeatureNews[0]) && count($aFeatureNews) >= 3) {
                $parent_cate_url = "";
                if (isset($aFeatureNews[0]->parent_cate_url) && $aFeatureNews[0]->parent_cate_url != "")
                    $parent_cate_url = $aFeatureNews[0]->parent_cate_url . "/";
            ?>            
            <article>
                <a class="thumbs img_165_93" title="<?php echo $aFeatureNews[0]->title; ?>" href="<?php echo $base_url . $parent_cate_url . $aFeatureNews[0]->news_cate_url . "/" . $aFeatureNews[0]->url . "-" . $aFeatureNews[0]->news_id; ?>.html">
                    <img src="<?php echo $img_url; ?>style/<?php echo $aFeatureNews[0]->img_thumb2; ?>" alt="<?php echo $aFeatureNews[0]->title; ?>"> </a>
                <h3>
				<a title="<?php echo $aFeatureNews[0]->title; ?>" href="<?php echo $base_url . $parent_cate_url . $aFeatureNews[0]->news_cate_url . "/" . $aFeatureNews[0]->url . "-" . $aFeatureNews[0]->news_id; ?>.html">
					<?php echo $aFeatureNews[0]->title; ?></a>
			</h3>
                <p class="desc_1"><?php echo $aNews[$i]->short_desc; ?></p>
            </article>
            <ul class="list-new">
                <?php
                $i = 1;
                array_shift($aFeatureNews); //next record
                foreach ($aFeatureNews as $key => $item):
                    if ($i >= 8) 
                        break;
                    if ($item->parent_cate_url != "")
                        $parent_cate_url = $item->parent_cate_url . "/";
                ?>  
                <li>
                    <a title="<?php echo $item->title; ?>" href="<?php echo $base_url . $parent_cate_url . "/" . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html">
                        <?php echo $item->title; ?></a>
                </li>               
                <?php
                    $i++;
                    $parent_cate_url = "";
                endforeach;
                ?> 
            </ul>
            <?php
            }
            ?>
        </div>       

    </aside>
</div>

<div class="block-adv">
</div>